﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using BluePumpkin.Library.AppCode.Context;

namespace BluePumpkin.Library
{
    public class FAQManager
    {
        public void Add(FAQs faqclass)
        {
            using (BdbContext DBContext = new BdbContext())
            {
                FAQs _faq = new FAQs
                {
                    Question = faqclass.Question,
                    status = faqclass.status
                };
                DBContext.FAQs.Add(_faq);
                DBContext.SaveChanges();
            }

        }

        public void Delete(FAQs faqclass)
        {
            using (BdbContext DBContext = new BdbContext())
            {
                //FAQ faq = new FAQ();

                var _faq = DBContext.FAQs.Single(x => x.Id == faqclass.Id);
                _faq.status = faqclass.status;

                DBContext.SaveChanges();
            }
        }

    }
}
